CREATE TABLE VPI.PRE_DEPLOY_VERSION
(
	SERVICE_ID		VARCHAR2(32)			NOT NULL,
	VERSION_		NUMBER(4)				NOT NULL,
	COMMENT_		VARCHAR2(2000),
	OBJECT_COUNT	NUMBER(4) DEFAULT 0		NOT NULL,
	DEPLOY_STATUS	NUMBER(1) DEFAULT 0		NOT NULL,
	DEPLOY_DATE		DATE,

	CONSTRAINT PK_PRE_DEPLOY_VERSION PRIMARY KEY (SERVICE_ID, VERSION_),
	CONSTRAINT FK_PRE_DEPLOY_VERSION FOREIGN KEY (SERVICE_ID) REFERENCES VPI.EXTRACT_SERVICE (SERVICE_ID)
);

COMMENT ON TABLE VPI.PRE_DEPLOY_VERSION
	IS 'Version history of pre-deployment';

COMMENT ON COLUMN VPI.PRE_DEPLOY_VERSION.SERVICE_ID
	IS 'The extract service (application) ID.';
COMMENT ON COLUMN VPI.PRE_DEPLOY_VERSION.VERSION_
	IS 'Version number of the extract service (application).';
COMMENT ON COLUMN VPI.PRE_DEPLOY_VERSION.COMMENT_
	IS 'Comment of the version.';
COMMENT ON COLUMN VPI.PRE_DEPLOY_VERSION.OBJECT_COUNT
	IS 'Count how many objects in this version to be deployed.';
COMMENT ON COLUMN VPI.PRE_DEPLOY_VERSION.DEPLOY_STATUS
	IS '0 = Not deployed; 1 = Deployed Successfully; -1 = Deployed with Error.';
COMMENT ON COLUMN VPI.PRE_DEPLOY_VERSION.DEPLOY_DATE
	IS 'When this version was deployed.';
